<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">

<head th:replace="header :: copy"></head>

<body>
	<h1>Account Search</h1>

	<p>Enter an account number or search for an account owner
		containing given specified text:</p>

	<form action="#" th:object="${searchCriteria}" method="GET"
		th:action="@{/accounts/dosearch}" class="form-horizontal">

		<!-- Account Number field -->
		<div class="form-group">
			<label for="number" class="control-label col-xs-2">Account
				Number</label>
			<div class="col-xs-2">
				<input type="text" class="form-control" id="number"
					th:field="*{accountNumber}" placeholder="Enter account number"
					style="width: 10em;" />
			</div>
			<div class="col-xs-8">Enter a valid 9 digit number</div>
		</div>

		<!-- Account Number errors (if any) -->
		<div class="form-group">
			<div class="control-label col-xs-2">&nbsp;</div>
			<div class="col-xs-2">&nbsp;</div>
			<div class="col-xs-8">
				<span th:if="${#fields.hasErrors('accountNumber')}"
					style="color: red; font-size: smaller" th:errors="*{accountNumber}">Incorrect
					data</span>
			</div>
		</div>

		<!-- Owner name field -->
		<div class="form-group">
			<label for="search" class="control-label col-xs-2">Owner
				Search</label>
			<div class="col-xs-2">
				<input type="text" class="form-control" id="search"
					th:field="*{searchText}" placeholder="Text from owner name"
					style="width: 10em;" />
			</div>
			<div class="col-xs-8">Case-insensitive, supports part name
				matching</div>
		</div>

		<!-- Owner name errors (if any) -->
		<div class="form-group">
			<div class="control-label col-xs-2">&nbsp;</div>
			<div class="col-xs-2">&nbsp;</div>
			<div class="col-xs-8">
				<span th:if="${#fields.hasErrors('searchText')}"
					style="color: red; font-size: smaller" th:errors="*{searchText}"></span>
			</div>
		</div>

		<!--  Submit button -->
		<div class="form-group">
			<div class="col-xs-offset-2 col-xs-10">
				<button type="submit" class="btn btn-primary">Find</button>
			</div>
		</div>
	</form>

	<div th:replace="footer :: copy"></div>

</body>
</html>
